import React, { Component } from 'react'
import {Switch, Route, Redirect} from "react-router-dom"
import ProductHome from "./Home"
import ProductAddUpdate from "./AddUpdate"
import ProductDetail from "./Detail"
import "./product.less"

/*
    商品路由  开发路程,首先设计子路由组件,然后设计各级路由的路径
    然后再设计各级路由的组件
 */
export default class Product extends Component {
    render() {
        return (
            <Switch>
                <Route path="/product" component={ProductHome} exact/> {/* 路径完全匹配 */}
                <Route path="/product/addupdate" component={ProductAddUpdate}/>
                <Route path="/product/detail" component={ProductDetail}/>
                <Redirect to="/product"/>
            </Switch>
        )
    }
}
   
